<body>
	<div class="container minh">
			<ol class="breadcrumb">
				<li class="breadcrumb-item">文章管理</li>
				<li class="breadcrumb-item active">文章发布</li>
			</ol>
			<form  id="mf" th:action="@{/console/publish}" method="post" enctype="multpart/form-data" th:class=" p-2">
				<div class="form-group mb-3">
					<label for="articleTitle">标题:</label> <input type="text" id="articleTitle" name="articleTitle" class="form-control" placeholder="请录入文章标题" required autofocus>
				</div>

				<div class="form-group mb-3">
					<label for="section">栏目:</label> <select id="section" name="section" class="form-control">
						<option value="imgnav">图片导航</option>
						<option value="article">博客信息</option>
					</select>
				</div>

				<div class="form-group mb-3">
					<label for="catagory">分类:</label> <select id="catagory" name="catagory" class="form-control">
						<option value="java">JAVA语言</option>
						<option value="python">Python语言</option>
						<option value="database">数据库</option>
						<option value="architec">应用架构</option>
					</select>
				</div>

				<div class="form-group mb-3">
					<label for="summary">摘要:</label>
					<textarea id="summary" name="summary" class="form-control" placeholder="摘要最多输入1024个字符"  autofocus></textarea>
				</div>

				<div class="form-group mb-3">
					<textarea id="editor" name="content"  cols="100"  autofocus></textarea>
				</div>

				<div class="form-group">
					<button type="button" class="btn btn-primary  pull-right ml-5 mr-3 mb-3"  onclick="clear_form()">取消</button>
					<button type="submit" class="btn btn-primary pull-right  mb-3">发布</button>
				</div>

			</form>
		</div>

	<script type="text/javascript">
		var editor = new Simditor({
			textarea : $('#editor'),
			toolbar : [
				  'title',
				  'bold',
				  'italic',
				  'underline',
				  'strikethrough',
				  'fontScale',
				  'color',
				  'ol', 
				  'ul', 
				  'blockquote',
				  'code',
				  'table',
				  'link',
				  'image',
				  'hr', 
				  'indent',
				  'outdent',
				  'alignment'
				],
			upload : {
				url : 'admin/upload',
				params : null,
				fileKey : "photo",
				connectionCount : 1,
				leaveConfirm : "正在上传,确定要取消上传文件吗?"
			}
		});
		
		function clear_form(){
			document.getElementById("mf").reset(); 
		}
	</script>

</body>